package com.mike.server.engine;

import java.nio.ByteBuffer;

import junit.framework.Assert;

import org.junit.Test;

public class GameMessageTester {
	
	@Test
	public void testGetTypeAndId() {
		GameMessage message = new GameMessage();
		ByteBuffer buff = ByteBuffer.allocate(8);
		buff.putInt(Integer.MAX_VALUE);
		buff.putInt(Integer.MIN_VALUE);
		buff.flip();
		message.put(buff.array());
		Assert.assertEquals(Integer.MAX_VALUE, message.getType());
		Assert.assertEquals(Integer.MIN_VALUE, message.getId());
	}
	
}
